package com.fql.research.common.jms;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.jms.listener.adapter.MessageListenerAdapter;
import org.springframework.stereotype.Component;

import com.fql.research.sys.domain.User;

@Component("queueReciver")
public class QueueReciver extends MessageListenerAdapter {
	//@JmsListener(destination = "userQueue",concurrency="5-10")
	public void onMessagehehe(Message message, Session session) throws JMSException{
    	User bean = (User) getMessageConverter().fromMessage(message);
        System.out.println(bean.getUserName());
        System.out.println(session);
        message.acknowledge();
        message.acknowledge();
	}
}
